package cn.cjxy.controller;

import cn.cjxy.domain.User;
import cn.cjxy.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HelloController {
    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/hello")
    public String hello() {
        return "hello";
    }

    @RequestMapping("/getAll")
    public List<User> getAll() {
        //select * from user
        List<User> users = userMapper.selectList(null);
        return users;
    }

}
